package com.example.javabasic.bean.demo2;

import java.io.*;

/**
 * @description 测试byte数组
 * @Author Lin FuYuan
 * @date 2021/2/8
 */
public class TestByte {


    public static void main(String[] args) throws IOException {

        File file = new File("C:\\Users\\Administrator\\Desktop\\问题总结.txt");
        BufferedInputStream stream = new BufferedInputStream(new FileInputStream(file));
        FileOutputStream fileOutputStream = new FileOutputStream(new File("C:\\Users\\Administrator\\Desktop\\问题总结2.txt"));
        byte[] b = new byte[5];
//        b[1] =  55;
        int read = stream.read(b);
        while(read!=-1){
            fileOutputStream.write(b,0,read);
            fileOutputStream.flush();
            read = stream.read(b);
        }
        System.out.println("写完了");




    }
}
